{%extends 'base01.html'%}
{%block refresh%}{%endblock%}
{%block title%}<title>{{article.a_title}}</title>{%endblock%}

{%block style%}
    <style>
        body{
            background-image: url({{url_for("static",filename="img/62.jpg")}});
        }
        .card{
            background-color:rgb(39, 43, 43);
            padding-bottom: 50px;
        }
        .column.middle{
            width: 70%;
        }

        textarea{
            width: 90%;
            height: 200px;

        }

    <style>

</style>
    </style>
{%endblock%}
{%block head1%}<h1>{{article.a_title}}</h1>{%endblock%}

{%block topnav%}
    <div class="topnav">
        <a href={{url_for("root.index")}}>首页</a>
        <a href={{url_for("article.articlelist",foid=article.fo_id)}}>文章列表</a>
        <a href={{url_for('file.upload')}}>上传</a>
        <a href={{url_for('file.download')}}>下载</a>
        <a href={{url_for("user.profile",uid=nuid)}} style="float: right;">我的主页</a>
        <a href="#L1" style="float: right;">前往底部</a>
    </div>
{%endblock%}


{%block leftcolumn%}
{%if page==1%}
<div class="card">
    <h2>楼主</h2>
    <br>
    <a href={{url_for('user.profile',uid=author.u_id)}}><img src={{author.u_img}} style="align-self: center;"  alt="404" width="50%"></a>
        <br>
        <p >{{author.u_name}}</p>
        <p >{{agroup.g_name}}</p>
        <p >{{article.a_uptime}}</p>
        <form action={{url_for("article.delaorc")}} method="post">
            <input type="hidden" name="csrf_token" value={{csrf_token()}}>
            <input type="hidden" name="dtype" value="a">
            <input type="hidden" name="did" value={{article.a_id}}>
            <input type="submit"  value="删除">
        </form>
        <form action={{url_for("article.editarti")}} method="">
            <input type="hidden" name="etype" value="a">
            <input type="hidden" name="eid" value={{article.a_id}}>
            <input type="submit"  value="编辑">
        </form>
</div>
{%endif%}
{%endblock%}
{%block middlecolumn%}
{%if page==1%}
            <div class="card">
            <article>
            <p>

            {{article.a_html|safe}}
            </p>
            </article>
            <br>
            {%if article.a_img!="0"%}
            <img src="{{article.a_img}}" alt="404" width="80%">
            {%endif%}
            </div>
            <br><br>
{%endif%}
{%endblock%}

{%block legs%}

{%for dblist in UGC%}
<hr>
<div class="row">

    <div class="column sides">
        <div class="card">
            <h2>{{loop.index+(page-1)*20}}楼</h2>
            <br>
            <a href={{url_for("user.profile",uid=dblist[0].u_id)}}><img src={{dblist[0].u_img}} alt="404" width="50%"></a>
            <br>
            <p>{{dblist[0].u_name}}</p>
            <p>{{dblist[1].g_name}}</p>
            <p>{{dblist[2].c_time}}</p>
            <form action={{url_for("article.delaorc")}} method="post">
            <input type="hidden" name="csrf_token" value={{csrf_token()}}>
            <input type="hidden" name="dtype" value="c">
            <input type="hidden" name="did" value={{dblist[2].c_id}}>
            <input type="submit"  value="删除">
        </form>
        </div>
    </div>

    <div class="column middle">
        <div class="card">
            <article>
                <p>
       {{dblist[2].html_content|safe}} 
       </p>
                </article>
        </div>
    </div>
    
</div>
{%endfor%}

<hr />
<div class="row">
    <div class="column sides">
        <div class="card" id="L1">
            <h3>{{form.context.label}}</h3>
        </div>
    </div>
    <div class="column middle">
    <div class="card">
        <br>
    <form method="post" style="text-align: left;text-indent: 2em;">
        <input type="hidden" name="csrf_token" value={{csrf_token()}}>
        {{form.context}}
        <br><br>
        {{form.submit}}
        {{pagedown.include_pagedown()}}
    </form>
    </div>
    </div>
</div>
{%endblock%}

{%block footer%}
<form method="get">

&emsp;
<input type="submit" value="跳转到"><input type="text" name="page" style="width: 50px;">
&emsp;

</form>
        <a href={{url_for("article.articlelist",foid=article.fo_id)}}> <p style="text-align: center;">返回文章目录</p></a>
{%endblock%}
